/*
 * © 2010 Autodata Solutions Company. All Rights Reserved
 * This source code is the confidential and proprietary information of Autodata Solutions Company.
 * The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code
 * without the prior written consent of Autodata Solutions Company.
 */
Ext.ns('net.autodata.compare');
(function (){
	var DQ = Ext.DomQuery;
	
	/**
	 * This view class defined how the InventoryPanel is rendered
	 * @class InventoryResultsView
	 * @extends net.autodata.compare.InventoryView
	 * @namespace net.autodata.compare
	 */
	var View = Ext.extend(net.autodata.compare.InventoryView, {
		
		/**
		 * @property panelWidths
		 * @type Object
		 */
		panelWidths: {
			resultsWidth: 186,
			baseVehicleWidth: 147,
			competitorWidth: 147,
			lastCompetitorWidth: 148
		},		
		
		/**
		 * @method initTemplates
		 */
		initTemplates: function ()
		{
			var ts = this.templates || {};
			
			if (!ts.mainTpl) {
				ts.mainTpl = new Ext.Template(
					'<div class="results-view">',
						'<div class="inventory-header"><h5>' + ASC.message('net.autodata.compare.inventory.label.inventory') + '</h5></div>',
						'<div class="inventory-body">',
							'<table border="0" cellpadding="0" cellspacing="0">',
								'<tr>',
									'<td class="first results" style="width:{resultsWidth}px;">',
										'<div class="result-wrap">',
											'<table border="0" cellpadding="0">',
												'<tr>',
													'<td class="highlight"></td>',
													'<td class="desc">' + ASC.message('net.autodata.compare.inventory.results-view.label.highlight-advantages') +'</td>',
												'</tr>',
											'</table>',
										'</div>',
									'</td>',
									'<td class="record basevehicle" style="width:{baseVehicleWidth}px;"><div class="basevehicle-wrap"></div></td>',
									'<td class="record competitor1" style="width:{competitorWidth}px;"><div class="competitor1-wrap"></div></td>',
									'<td class="record competitor2" style="width:{competitorWidth}px;"><div class="competitor2-wrap"></div></td>',
									'<td class="record last competitor3" style="width:{lastCompetitorWidth}px;"><div class="competitor3-wrap"></div></td>',
								'</tr>',
							'</table>',
						'</div>',
					'</div>',
					{
						compiled: true,
						disableFormats: true
					}
				);
			}
			
			this.templates = ts;
			
			View.superclass.initTemplates.apply(this, arguments);
		}		
	});
	
	net.autodata.compare.InventoryResultsView = View;
	
})();